﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lockery
{
    public partial class LockeryForm : Form
    {
        public LockeryForm()
        {
            InitializeComponent();
            LockerySettings.myPrefs.Load();

            //Checkboxes
            checkBoxMovement.Checked = LockerySettings.myPrefs.DisableMovement;
            checkBoxFacing.Checked = LockerySettings.myPrefs.DisableFacing;
            checkBoxTargetting.Checked = LockerySettings.myPrefs.DisableTargetting;
            checkBoxAutoCallPet.Checked = LockerySettings.myPrefs.AutoCallPet;
            checkBoxSoulstoneOnMe.Checked = LockerySettings.myPrefs.SoulstoneOnMe;
            checkBoxNoAoeSolo.Checked = LockerySettings.myPrefs.NoAoeSolo; 
            checkBoxSummonInfernal.Checked = LockerySettings.myPrefs.SummonInfernal;
            checkBoxSummonDoomguard.Checked = LockerySettings.myPrefs.SummonDoomguard;

            //numericUpDown
            numericUpDownHealthTunnel.Value = new decimal(LockerySettings.myPrefs.HealthTunnel);
            numericUpDownDrainLife.Value = new decimal(LockerySettings.myPrefs.DrainLife);
            numericUpDownNoCorruption.Value = new decimal(LockerySettings.myPrefs.NoCorruption);
            numericUpDownUseAoe.Value = new decimal(LockerySettings.myPrefs.UseAoe);
            numericUpDownDrinkMana.Value = new decimal(LockerySettings.myPrefs.DrinkMana);
            numericUpDownEatFood.Value = new decimal(LockerySettings.myPrefs.EatDrink);
            numericUpDownHealthstone.Value = new decimal(LockerySettings.myPrefs.healthstone);
            numericUpDownHealthpotion.Value = new decimal(LockerySettings.myPrefs.HealthPotion);
            numericUpDownNaruu.Value = new decimal(LockerySettings.myPrefs.GiftOfNaruu);
            numericUpDownFunnelOutCombat.Value = new decimal(LockerySettings.myPrefs.HealthTunnelOutCombat);
            numericUpDownEmberTap.Value = new decimal(LockerySettings.myPrefs.EmberTap);
            numericUpDownDarkBargain.Value = new decimal(LockerySettings.myPrefs.DarkBargain);
            numericUpDownLikeBosses.Value = new decimal(LockerySettings.myPrefs.ElitesHealth);

            comboBoxTrinket1.SelectedIndex = LockerySettings.myPrefs.Trinket1;
            comboBoxTrinket2.SelectedIndex = LockerySettings.myPrefs.Trinket2;
            comboBoxEngiGloves.SelectedIndex = LockerySettings.myPrefs.UseEngiGloves;
            comboBoxLifeblood.SelectedIndex = LockerySettings.myPrefs.Lifeblood;
            comboBoxAlchemyFlask.SelectedIndex = LockerySettings.myPrefs.AlchFlask;
            comboBoxJadeSerpent.SelectedIndex = LockerySettings.myPrefs.PotionBuff;
            comboBoxIntFlask.SelectedIndex = LockerySettings.myPrefs.BuffFlask;
            comboBoxDarkSoul.SelectedIndex = LockerySettings.myPrefs.DarkSoul;

            //Radiobuttons
            switch (LockerySettings.myPrefs.CallPet)
            {
                case "Imp":
                    radioButtonDemon.Select();
                    break;
                case "Voidwalker":
                    radioButtonVoidwalker.Select();
                    break;
                case "Succubus":
                    radioButtonSuccubus.Select();
                    break;
                case "Felhunter":
                    radioButtonFelhunter.Select();
                    break;
            }
            switch (LockerySettings.myPrefs.SacrificePet)
            {
                case "party":
                    radioButtonSacrificePetparty.Select();
                    break;
                case "always":
                    radioButtonSacrificePetAlways.Select();
                    break;
            }
        }

        private void buttonSave_Click(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.Save();
            Close();
        }

        private void radioButtonDemon_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.CallPet = "Imp";
        }

        private void radioButtonVoidwalker_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.CallPet = "Voidwalker";
        }

        private void radioButtonSuccubus_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.CallPet = "Succubus";
        }

        private void radioButtonFelhunter_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.CallPet = "Felhunter";
        }

        private void checkBoxMovement_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DisableMovement = checkBoxMovement.Checked;
        }

        private void checkBoxFacing_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DisableFacing = checkBoxFacing.Checked;
        }

        private void checkBoxTargetting_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DisableTargetting = checkBoxTargetting.Checked;
        }

        private void checkBoxAutoCallPet_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.AutoCallPet = checkBoxAutoCallPet.Checked;
        }

        private void numericUpDownHealthTunnel_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.HealthTunnel = (int)numericUpDownHealthTunnel.Value;
        }

        private void numericUpDownDrainLife_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DrainLife = (int)numericUpDownDrainLife.Value;
        }

        private void numericUpDownNoCorruption_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.NoCorruption = (int)numericUpDownNoCorruption.Value;
        }
         
        private void checkBoxSoulstoneOnMe_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.SoulstoneOnMe = checkBoxSoulstoneOnMe.Checked;
        }

        private void numericUpDownUseAoe_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.UseAoe = (int)numericUpDownUseAoe.Value;
        } 

        private void checkBoxNoAoeSolo_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.NoAoeSolo = checkBoxNoAoeSolo.Checked;
        }

        private void numericUpDownDrinkMana_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DrinkMana = (int)numericUpDownDrinkMana.Value;
        }

        private void numericUpDownEatFood_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.EatDrink = (int)numericUpDownEatFood.Value;
        }

        private void numericUpDownHealthstone_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.healthstone = (int)numericUpDownHealthstone.Value;
        }

        private void numericUpDownHealthpotion_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.HealthPotion = (int)numericUpDownHealthpotion.Value;
        }

        private void numericUpDownNaruu_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.GiftOfNaruu = (int)numericUpDownNaruu.Value;
        }

        private void radioButtonSacrificePetparty_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.SacrificePet = "party";
        }

        private void radioButtonSacrificePetAlways_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.SacrificePet = "always";
        }

        private void numericUpDownFunnelOutCombat_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.HealthTunnelOutCombat = (int)numericUpDownFunnelOutCombat.Value;
        } 

        private void numericUpDownEmberTap_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.EmberTap = (int)numericUpDownEmberTap.Value;
        } 

        private void numericUpDownDarkBargain_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DarkBargain = (int)numericUpDownDarkBargain.Value;
        }

        private void checkBoxSummonInfernal_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.SummonInfernal = checkBoxSummonInfernal.Checked;
        }

        private void checkBoxSummonDoomguard_CheckedChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.SummonDoomguard = checkBoxSummonDoomguard.Checked;
        }

        private void numericUpDownLikeBosses_ValueChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.ElitesHealth = (int)numericUpDownLikeBosses.Value;
        }

        private void comboBoxTrinket1_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.Trinket1 = comboBoxTrinket1.SelectedIndex;
        }

        private void comboBoxTrinket2_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.Trinket2 = comboBoxTrinket2.SelectedIndex;
        }

        private void comboBoxEngiGloves_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.UseEngiGloves = comboBoxEngiGloves.SelectedIndex;
        }

        private void comboBoxLifeblood_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.Lifeblood = comboBoxLifeblood.SelectedIndex;
        }

        private void comboBoxAlchemyFlask_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.AlchFlask = comboBoxAlchemyFlask.SelectedIndex;
        }

        private void comboBoxJadeSerpent_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.PotionBuff = comboBoxJadeSerpent.SelectedIndex;
        }

        private void comboBoxIntFlask_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.BuffFlask = comboBoxIntFlask.SelectedIndex;
        }

        private void comboBoxDarkSoul_SelectedIndexChanged(object sender, EventArgs e)
        {
            LockerySettings.myPrefs.DarkSoul = comboBoxDarkSoul.SelectedIndex;
        }

         

    }
}
